import axios from 'axios'
import qs from 'qs'
import store from 'store/index'
import { Message } from 'element-ui'
import VueRouter from 'router/index'
import { EventBus } from "bus/mybus.js";

const deleteRequest = axios.create({
	timeout: 1000000,                                   												//超时时间..
	//接口基路径..
	baseURL: "https://api.asset.havefunner.com/asserts/",
	// baseURL: "http://rap2api.taobao.org/app/mock/297978/",
	// baseURL: "http://172.22.29.59:8080/asserts/",
	// baseURL: "http://219.216.65.8:8080/asserts/",														//接口基路径..
	// transformRequest: data => qs.stringify(data)  
	paramsSerializer: params => {
		return qs.stringify(params, { indices: false })
	},  												//post请求参数处理,防止跨域..
})
//请求拦截器..
// deleteRequest.interceptors.request.use(config => {
// 	// 判断是否存在token，如果存在的话，则每个http header都加上token
// 	let token = localStorage.getItem('token')
// 	if (!config.headers.hasOwnProperty('Authorization1') && token) {
// 		config.headers.Authorization1 = token;
// 	}
// 	return config;
// },
// 	err => {
// 		return Promise.reject(err)
// 	})


export default deleteRequest